package com.atguigu.gmall.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author tongatong
 * @name ThreadPoolConfig
 * @description 线程池
 * @date 2021/9/16
 * @time 22:56
 */
@Configuration
public class ThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(8, 100, 10, TimeUnit.SECONDS, new ArrayBlockingQueue<>(200));
    }
}
